package com.jmyd.coupon.server.domain.po;

import com.jmyd.commons.base.po.BaseSimpleStandardPo;
import com.jmyd.coupon.server.domain.dto.SceneCouponUsedRecordQueryDto;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author samphin
 * @since 2021/7/14 16:15
 */
@Data
@Table(name = "scene_coupon_use_record")
public class SceneCouponUseRecord extends BaseSimpleStandardPo<Long> implements Serializable {

    /**
     * 用户ID
     */
    @Column(name = "USER_ID")
    private String userId;

    /**
     * 用户账号
     */
    @Column(name = "USERNAME")
    private String username;

    /**
     * 用户昵称
     */
    @Column(name = "NICKNAME")
    private String nickname;

    /**
     * 业务ID
     */
    private String businessId;

    /**
     * 优惠券ID
     */
    @Column(name = "COUPON_ID")
    private Long couponId;

    public SceneCouponUseRecord build(SceneCouponUsedRecordQueryDto queryDto) {
        BeanUtils.copyProperties(queryDto, this);
        return this;
    }
}